﻿<catel:DataWindow x:Class="Catel.Examples.WPF.Memento.Views.MainWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:catel="http://catel.codeplex.com"
                  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                  MinWidth="525"
                  MinHeight="350"
                  Icon="/Catel.Examples.WPF.Memento;component/Resources/Images/Catel.png"
                  ResizeMode="CanResizeWithGrip"
                  ShowInTaskbar="True"
                  SizeToContent="Manual"
                  WindowStartupLocation="Manual"
                  WindowState="Maximized">

    <!--  Resources  -->
    <Window.Resources />

    <!--  Content  -->
    <DockPanel LastChildFill="True">
        <!--  Details and actions  -->
        <StackPanel DockPanel.Dock="Right" Orientation="Vertical">
            <!--  Details  -->
            <!--
                <GroupBox Header="Details">
                
                </GroupBox>
            -->

            <!--  Buttons  -->
            <WrapPanel>
                <!--  Added  -->
                <Button Command="{Binding Add}"
                        Style="{DynamicResource ImageButtonStyle}"
                        ToolTip="Add">
                    <Image Source="/Catel.Examples.WPF.Memento;component/Resources/Images/add.png" />
                </Button>

                <!--  Edit  -->
                <Button Command="{Binding Edit}"
                        Style="{DynamicResource ImageButtonStyle}"
                        ToolTip="Edit">
                    <Image Source="/Catel.Examples.WPF.Memento;component/Resources/Images/edit.png" />
                </Button>

                <!--  Remove  -->
                <Button Command="{Binding Remove}"
                        Style="{DynamicResource ImageButtonStyle}"
                        ToolTip="Remove">
                    <Image Source="/Catel.Examples.WPF.Memento;component/Resources/Images/delete.png" />
                </Button>
            </WrapPanel>
            <WrapPanel>
                <!--  Undo  -->
                <Button Command="{Binding Undo}"
                        Style="{DynamicResource ImageButtonStyle}"
                        ToolTip="Add">
                    <Image Source="/Catel.Examples.WPF.Memento;component/Resources/Images/undo.png" />
                </Button>

                <!--  Redo  -->
                <Button Command="{Binding Redo}"
                        Style="{DynamicResource ImageButtonStyle}"
                        ToolTip="Edit">
                    <Image Source="/Catel.Examples.WPF.Memento;component/Resources/Images/redo.png" />
                </Button>
            </WrapPanel>
        </StackPanel>

        <!--  List of persons  -->
        <ListBox DockPanel.Dock="Left"
                 ItemsSource="{Binding PersonCollection}"
                 SelectedItem="{Binding SelectedPerson}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDoubleClick">
                    <catel:EventToCommand Command="{Binding Edit}" DisableAssociatedObjectOnCannotExecute="False" />
                </i:EventTrigger>
            </i:Interaction.Triggers>

            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Label Content="{Binding FirstName}" />
                        <Label Content="{Binding MiddleName}" />
                        <Label Content="{Binding LastName}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </DockPanel>
</catel:DataWindow>
